# --------------------------------------------------------
# MySQL Schema for RPG+ 1.0.0 Beta
# - By Darkmonkey - 12/1/2005
# --------------------------------------------------------

INSERT INTO `phpbb_config` VALUES ('battle_exp', '1');
INSERT INTO `phpbb_config` VALUES ('exp_on_post', 'on');
INSERT INTO `phpbb_config` VALUES ('exp_gain', '5');
INSERT INTO `phpbb_config` VALUES ('inc_curve', '10');
INSERT INTO `phpbb_config` VALUES ('rpgprofile_on_topic', 'on');
INSERT INTO `phpbb_config` VALUES ('rpgstats_on_topic', 'on');
INSERT INTO `phpbb_config` VALUES ('rpgstats_align', 'left');
INSERT INTO `phpbb_config` VALUES ('battle_music_on', 'on');
INSERT INTO `phpbb_config` VALUES ('rpgprofile_on_profile', 'on');
INSERT INTO `phpbb_config` VALUES ('hp_cost', '50');
INSERT INTO `phpbb_config` VALUES ('mp_cost', '100');
INSERT INTO `phpbb_config` VALUES ('pp_cost', '100');
INSERT INTO `phpbb_config` VALUES ('attack_hit_miss', '12');
INSERT INTO `phpbb_config` VALUES ('weapon_hit_miss', '8');
INSERT INTO `phpbb_config` VALUES ('magic_hit_miss', '6');
INSERT INTO `phpbb_config` VALUES ('uplimit', '6');
INSERT INTO `phpbb_config` VALUES ('full_limit', '120');
INSERT INTO `phpbb_config` VALUES ('exp_battle_win', '100');
INSERT INTO `phpbb_config` VALUES ('life_cost', '15');
INSERT INTO `phpbb_config` VALUES ('default_hp', '110');
INSERT INTO `phpbb_config` VALUES ('default_mp', '60');
INSERT INTO `phpbb_config` VALUES ('default_pp', '60');
INSERT INTO `phpbb_config` VALUES ('default_max_items', '5');
INSERT INTO `phpbb_config` VALUES ('default_atk', '40');
INSERT INTO `phpbb_config` VALUES ('default_def', '40');
INSERT INTO `phpbb_config` VALUES ('default_mgatk', '40');
INSERT INTO `phpbb_config` VALUES ('default_mgdef', '40');
INSERT INTO `phpbb_config` VALUES ('item_hold_lvl', '2');
INSERT INTO `phpbb_config` VALUES ('item_hold_inc', '2');
INSERT INTO `phpbb_config` VALUES ('rand_battles', '1');
INSERT INTO `phpbb_config` VALUES ('wager_limit', '1000');
INSERT INTO `phpbb_config` VALUES ('rpgworld', 'RPG World');
INSERT INTO `phpbb_config` VALUES ('rpg_stats_limit', '5');
INSERT INTO `phpbb_config` VALUES ('arena_online', '1');
INSERT INTO `phpbb_config` VALUES ('rpgshop_online', '1');
INSERT INTO `phpbb_config` VALUES ('hospital_online', '1');
INSERT INTO `phpbb_config` VALUES ('rpgstats_online', '1');
INSERT INTO `phpbb_config` VALUES ('rpghelp_online', '1');
INSERT INTO `phpbb_config` VALUES ('battle_interval', '3600');
INSERT INTO `phpbb_config` VALUES ('points_reply', '1');
INSERT INTO `phpbb_config` VALUES ('points_topic', '2');
INSERT INTO `phpbb_config` VALUES ('points_page', '1');
INSERT INTO `phpbb_config` VALUES ('points_post', '1');
INSERT INTO `phpbb_config` VALUES ('points_browse', '0');
INSERT INTO `phpbb_config` VALUES ('points_donate', '1');
INSERT INTO `phpbb_config` VALUES ('points_name', 'Gold');
INSERT INTO `phpbb_config` VALUES ('points_user_group_auth_ids', '');
INSERT INTO `phpbb_config` VALUES ('points_system_version', '2.1.1');

ALTER TABLE `phpbb_forums` ADD `exp_post` INT( 10 ) DEFAULT '1' NOT NULL ,
ADD `in_rpg` INT( 10 ) DEFAULT '1' NOT NULL ,
ADD `forum_battles` TINYINT( 4 ) DEFAULT '0' NOT NULL ,
ADD `points_disabled` TINYINT( 1 ) NOT NULL ;

CREATE TABLE phpbb_rpg_ai (
  ai_id int(20) NOT NULL auto_increment,
  ai_name varchar(50) NOT NULL default '',
  ai_image varchar(255) NOT NULL default '',
  ai_hp int(30) NOT NULL default '100',
  ai_mp int(30) NOT NULL default '50',
  ai_pp int(30) NOT NULL default '50',
  ai_atk int(30) NOT NULL default '30',
  ai_def int(30) NOT NULL default '30',
  ai_mgatk int(30) NOT NULL default '30',
  ai_mgdef int(30) NOT NULL default '30',
  ai_level int(20) NOT NULL default '0',
  PRIMARY KEY  (ai_id)
) ;

CREATE TABLE `phpbb_rpg_ai_attacks` (
  `atk_id` int(30) NOT NULL auto_increment,
  `atk_ai_id` int(30) NOT NULL default '0',
  `atk_name` varchar(50) NOT NULL default '',
  `atk_buff` int(30) NOT NULL default '0',
  `atk_type` varchar(50) NOT NULL default 'atk',
  `atk_cost` int(10) NOT NULL default '0',
  PRIMARY KEY  (`atk_id`)
) AUTO_INCREMENT=1 ;

CREATE TABLE `phpbb_rpg_area` (
  `a_id` int(20) NOT NULL auto_increment,
  `a_name` varchar(40) NOT NULL default '',
  `a_image` varchar(100) NOT NULL default '',
  `a_music` varchar(100) NOT NULL default '',
  PRIMARY KEY  (`a_id`)
) AUTO_INCREMENT=1 ;

CREATE TABLE `phpbb_rpg_battle_ai` (
  `bai_b_id` int(30) NOT NULL default '0',
  `bai_ai_id` int(30) NOT NULL default '0',
  `bai_hp` int(30) NOT NULL default '0',
  `bai_mp` int(30) NOT NULL default '0',
  `bai_pp` int(30) NOT NULL default '0'
) ;

CREATE TABLE `phpbb_rpg_battle_logs` (
  `log_id` int(11) NOT NULL auto_increment,
  `battle_id` int(11) NOT NULL default '0',
  `log` varchar(255) NOT NULL default '',
  `log_datetime` int(11) NOT NULL default '0',
  KEY `log_id` (`log_id`)
) AUTO_INCREMENT=1 ;

CREATE TABLE `phpbb_rpg_battle_taunts` (
  `id` int(20) NOT NULL auto_increment,
  `battle_id` int(20) NOT NULL default '0',
  `poster` varchar(100) NOT NULL default '0',
  `message` varchar(255) NOT NULL default '',
  KEY `id` (`id`)
) AUTO_INCREMENT=1 ;

CREATE TABLE `phpbb_rpg_battles` (
  `b_id` int(15) NOT NULL auto_increment,
  `b_type` varchar(10) NOT NULL default '',
  `b_p1` int(15) NOT NULL default '0',
  `b_p2` int(15) NOT NULL default '0',
  `b_area` varchar(100) NOT NULL default '',
  `b_status` varchar(10) NOT NULL default 'waiting',
  `b_wager` int(20) NOT NULL default '0',
  `b_turn` varchar(5) NOT NULL default 'p1',
  `b_ai_id` int(20) NOT NULL default '0',
  `b_winner` varchar(100) NOT NULL default '',
  KEY `b_id` (`b_id`)
) AUTO_INCREMENT=1 ;

CREATE TABLE `phpbb_rpg_element` (
  `name` varchar(30) NOT NULL default '',
  `image` varchar(30) NOT NULL default '',
  `opposite` varchar(30) NOT NULL default ''
) ;

INSERT INTO `phpbb_rpg_element` VALUES ('Wind', 'wind.gif', 'Earth');
INSERT INTO `phpbb_rpg_element` VALUES ('Earth', 'earth.gif', 'Wind');
INSERT INTO `phpbb_rpg_element` VALUES ('Dark', 'dark.gif', 'Light');
INSERT INTO `phpbb_rpg_element` VALUES ('Light', 'light.gif', 'Dark');
INSERT INTO `phpbb_rpg_element` VALUES ('Fire', 'fire.gif', 'Water');
INSERT INTO `phpbb_rpg_element` VALUES ('Water', 'water.gif', 'Fire');
INSERT INTO `phpbb_rpg_element` VALUES ('Omega', 'omega.gif', 'Omega');

CREATE TABLE `phpbb_rpg_help` (
  `art_id` int(11) NOT NULL auto_increment,
  `art_order` int(11) NOT NULL default '0',
  `art_name` varchar(50) NOT NULL default '',
  `art_desc` varchar(100) NOT NULL default '',
  `art_content` text NOT NULL,
  `art_bbcode_uid` varchar(10) NOT NULL default '',
  PRIMARY KEY  (`art_id`)
) AUTO_INCREMENT=1 ;

CREATE TABLE `phpbb_rpg_job` (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(30) NOT NULL default '',
  `image` varchar(40) NOT NULL default 'blank.gif',
  `job_desc` varchar(255) NOT NULL default '',
  `lvl_need` int(20) NOT NULL default '0',
  `salary` int(20) NOT NULL default '100',
  `gender` varchar(20) NOT NULL default '',
  KEY `id` (`id`)
) AUTO_INCREMENT=1 ;

CREATE TABLE `phpbb_rpg_race` (
  `name` varchar(30) NOT NULL default '',
  `race_desc` varchar(255) NOT NULL default '',
  `hp` int(20) NOT NULL default '0',
  `mp` int(20) NOT NULL default '0',
  `pp` int(20) NOT NULL default '0',
  `atk` int(20) NOT NULL default '0',
  `mgatk` int(20) NOT NULL default '0',
  `def` int(20) NOT NULL default '0',
  `mgdef` int(20) NOT NULL default '0',
  `level` int(20) NOT NULL default '0'
) ;

CREATE TABLE `phpbb_rpg_shop_config` (
  `id` int(20) NOT NULL auto_increment,
  `name` varchar(30) NOT NULL default '',
  `status` int(20) NOT NULL default '0',
  `shop_desc` varchar(255) NOT NULL default '',
  KEY `id` (`id`)
) AUTO_INCREMENT=1 ;

CREATE TABLE `phpbb_rpg_shop_items` (
  `id` int(10) NOT NULL auto_increment,
  `shop_id` int(10) NOT NULL default '0',
  `name` varchar(40) NOT NULL default '',
  `cost` int(20) NOT NULL default '0',
  `buff` int(20) NOT NULL default '0',
  `special` varchar(30) NOT NULL default '',
  `stock` int(20) NOT NULL default '0',
  `sold` int(20) NOT NULL default '0',
  `level` int(20) NOT NULL default '0',
  `item_desc` varchar(255) NOT NULL default '',
  `image` varchar(50) NOT NULL default '',
  `pp` int(20) NOT NULL default '0',
  `type` varchar(30) NOT NULL default '',
  KEY `id` (`id`)
) AUTO_INCREMENT=1 ;

CREATE TABLE `phpbb_rpg_user_items` (
  `id` int(40) NOT NULL auto_increment,
  `item_id` int(20) NOT NULL default '0',
  `user_id` int(20) NOT NULL default '0',
  KEY `id` (`id`)
) AUTO_INCREMENT=1 ;

ALTER TABLE `phpbb_users` ADD `user_in_rpg` INT( 10 ) DEFAULT '1' NOT NULL ,
ADD `user_notify_donation` TINYINT(1) NOT NULL ,
ADD `user_points` INT(20) NOT NULL ,
ADD `admin_allow_points` TINYINT(1) DEFAULT '1' NOT NULL ,
ADD `user_rpgname` VARCHAR( 30 ) DEFAULT 'Unknown' NOT NULL ,
ADD `user_gender` VARCHAR( 20 ) DEFAULT 'Undecided' NOT NULL ,
ADD `user_lvl` INT( 30 ) DEFAULT '1' NOT NULL ,
ADD `user_exp` INT( 50 ) DEFAULT '0' NOT NULL ,
ADD `user_max_exp` INT( 50 ) DEFAULT '100' NOT NULL ,
ADD `user_race` VARCHAR( 30 ) DEFAULT 'Unknown' NOT NULL ,
ADD `user_job` VARCHAR( 30 ) DEFAULT 'Unknown' NOT NULL ,
ADD `user_element` VARCHAR( 30 ) DEFAULT 'Unknown' NOT NULL ,
ADD `user_alignment` VARCHAR( 30 ) DEFAULT 'Unknown' NOT NULL ,
ADD `user_hp` INT( 50 ) DEFAULT '500' NOT NULL ,
ADD `user_max_hp` INT( 50 ) DEFAULT '500' NOT NULL ,
ADD `user_mp` INT( 50 ) DEFAULT '100' NOT NULL ,
ADD `user_max_mp` INT( 50 ) DEFAULT '100' NOT NULL ,
ADD `user_pp` INT( 50 ) DEFAULT '100' NOT NULL ,
ADD `user_max_pp` INT( 50 ) DEFAULT '100' NOT NULL ,
ADD `user_atk` INT( 50 ) DEFAULT '50' NOT NULL ,
ADD `user_mgatk` INT( 50 ) DEFAULT '50' NOT NULL ,
ADD `user_def` INT( 50 ) DEFAULT '50' NOT NULL ,
ADD `user_mgdef` INT( 50 ) DEFAULT '50' NOT NULL ,
ADD `user_rpg_avatar` VARCHAR( 100 ) DEFAULT '' NOT NULL ,
ADD `user_rpg_desc` VARCHAR( 255 ) DEFAULT 'Unknown' NOT NULL ,
ADD `user_max_items` INT( 20 ) DEFAULT '5' NOT NULL ,
ADD `user_lchar` VARCHAR( 50 ) DEFAULT 'Unknown' NOT NULL ,
ADD `user_rchar` VARCHAR( 50 ) DEFAULT 'Unknown' NOT NULL ,
ADD `user_bgmusic` TINYINT( 4 ) DEFAULT '0' NOT NULL ,
ADD `user_limit` INT( 10 ) DEFAULT '0' NOT NULL ,
ADD `user_special_move` VARCHAR( 100 ) NOT NULL ,
ADD `user_bloses` INT( 20 ) DEFAULT '0' NOT NULL ,
ADD `user_bwins` INT( 20 ) DEFAULT '0' NOT NULL ,
ADD `user_rand_battles` TINYINT( 2 ) DEFAULT '0' NOT NULL ,
ADD `user_notify_bturn` TINYINT( 4 ) DEFAULT '0' NOT NULL ,
ADD `user_last_battle` INT( 11 ) DEFAULT '0' NOT NULL ;
